package com.second.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "clms-client")
public interface ClientFeign {

    /**
     * 根据id查询优惠券的优惠金额
     * @param couponId  优惠券id
     * @return  优惠金额
     */
    @GetMapping("/coupon/getCouponAmountById")
    Integer getCouponAmountById(@RequestParam("couponId") Integer couponId);

    /**
     * 客户使用余额下单，根据客户id，减去客户的账户余额
     * @param clientId 客户id
     * @param paidAmount 实付金额
     * @return 修改结果
     */
    @GetMapping("/client/deductAccountBalance")
    boolean deductAccountBalance(@RequestParam("clientId")Integer clientId,
                                 @RequestParam("paidAmount")Double paidAmount);

}
